import React, { Component } from 'react';
import "../../styles/search/Searchbox.css"
import { SearchSearchKey } from "../../api/search";
class Searchbox extends Component {
    constructor(props) {
        super(props)
        this.state = {
            searchkey: ""
        }
    }


    GetSearchKey(e) {
        this.setState({
            [e.target.name]: e.target.value
        })
        SearchSearchKey({ searchkey: e.target.value }).then((res) => { console.log(res); })
    }


    render() {
        // console.log(this.state.searchkey);
        return (
            <div className='Searchbox'>
                <input type="text" placeholder='搜索店铺内商品' value={this.state.searchkey} name="searchkey" onChange={(e) => { this.GetSearchKey(e) }} /><span>取消</span>
            </div>
        );
    }
}

export default Searchbox;